/*签到*/
$('#sign-in').on("click", function(e) {
	$.post(globalData.server + "public/addSignMain", {
		"signstate": 1,
		"userid": globalData.getUid()
	}, function(result) {
		if(result.count > 0) {
			layer.msg(result.msg);
			$(".sign-color").load().css("color", "#dba401");
			$("#sign-in").css("display", "none");
			$("#sign-back").css("display", "");
		} else if(result.count == -1) {
			layer.msg(result.msg);
		}
	}, "json");
});
/*签退*/
$('#sign-back').on("click", function(e) {
	$.post(globalData.server + "public/updateByUseridMain", {
		"signstate": 2,
		"userid": globalData.getUid()
	}, function(res) {
		if(res.count > 0) {
			layer.msg(res.msg);
			$(".sign-color").load().css("color", "#008000");
			$("#sign-in").css("display", "");
			$("#sign-back").css("display", "none");
		} else if(res.count == -1) {
			layer.msg(res.msg);
		}

	}, "json");
});